<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:mumu="http://java.sun.com/jsf/composite/mumu">
    <rich:dataTable id="depList" value="#{depBean.lazyDataModelLazy}" var="record" keepSaved="true"
                    iterationStatusVar="it" rows="15" rowClasses="odd-row,even-row">
        <f:facet name="header">
            <h:outputText value="#{msg['dep.table.info']}"/>
        </f:facet>
        <rich:column>
            <f:facet name="header">#</f:facet>
            #{it.index +1}
        </rich:column>
        <ui:decorate template="/WEB-INF/template/sortColumn.xhtml">
            <ui:param name="bean" value="#{depBean}"/>
            <ui:param name="property" value="depName"/>
            <ui:param name="sortName" value="#{msg['dep.name']}"/>
            <ui:param name="render" value="depList@body scroller @this"/>
            <ui:define name="outText">
                <h:outputText id="name" value="#{record['depName']}"/>
            </ui:define>
        </ui:decorate>
        <rich:column>
            <f:facet name="header">#{msg['dep.sign']}</f:facet>
            <h:commandLink value="#{record['depSign']}">
                <f:ajax event="click" execute="@this" render="@none"/>
            </h:commandLink>
        </rich:column>
        <ui:decorate template="/WEB-INF/template/sortColumn.xhtml">
            <ui:param name="bean" value="#{depBean}"/>
            <ui:param name="property" value="createTime"/>
            <ui:param name="sortName" value="#{msg['createTime']}"/>
            <ui:param name="render" value="depList@body scroller @this"/>
            <ui:define name="outText">
                <h:outputLabel id="createTime" value="#{record['createTime']}" converter="longDateConverter"/>
            </ui:define>
        </ui:decorate>
        <rich:column>
            <f:facet name="header">#{msg['table.action']}</f:facet>
            <a4j:commandLink styleClass="no-decor" limitRender="true" render="editDepEntity"

                             execute="@this" oncomplete="PawnPopup.show('depEntity')">
                <h:graphicImage value="#{resource['images/edit.gif']}"/>
                <f:setPropertyActionListener value="#{record}" target="#{depBean.entity}"/>
            </a4j:commandLink>

            <a4j:commandLink styleClass="no-decor" limitRender="true" render="@none"
                             execute="@this" onclick="#{rich:component('confirmPane')}.show()">
                <h:graphicImage value="#{resource['images/delete.gif']}"/>
                <f:setPropertyActionListener value="#{record}" target="#{depBean.entity}"/>
            </a4j:commandLink>
        </rich:column>
        <f:facet name="footer">
            <rich:dataScroller id="scroller"/>
        </f:facet>
    </rich:dataTable>
    <mumu:confirmAction msg="#{msg['delete.msg']}" render="depList@body scroller" faction="#{depBean.remove}"/>

</ui:composition>